home *** CD-ROM | disk | FTP | other *** search
Prolog Source | 1986-10-07 | 613 b | 25 lines |
- /* Program 41 */
- /*
- Use <Ctrl><Break> to end this program
- */
-
- predicates
- piano
- tone(char,integer)
-
- goal
- write("Use <Ctrl><Break>\nto end this program\nPlay\n w e t y u\n"),
- write(" a s d f g h j k"),
- piano.
-
- clauses
- piano:-
- readchar(Note),tone(Note,Freq),sound(5,Freq),piano.
-
- tone('a',131). tone('w',139). tone('s',147).
- tone('d',165). tone('e',156). tone('f',175).
- tone('t',185). tone('g',196). tone('y',208).
- tone('h',220). tone('u',233). tone('j',247).
- tone('k',262).
- tone(_,18000). /*all other keys squeak*/
-